<?php

$mcrp = './../';
include_once($mcrp . 'functions/users.php');
include_once($mcrp . 'functions/contests.php');
include_once($mcrp . 'functions/security.php');
include_once($mcrp . 'functions/sql.php');
Secure();

global $mcsql;
$mcsql = new SQL;

# return username:rank:score:maxscore:challssolved:challcount:usercount
if (!isset($_GET['username']) || is_array($_GET['username']) ) { 
	die('0'); 
}

$user = GetUser($_GET['username']);
if($user === false) die('0');

$rank = $user->rank;
$score = $user->points;
$maxscore = GetMaxPoints();
$challsolved = count($user->contestcompleted);
$challcount = GetContestsCount();
$usercount = GetUsersCount();

die(sprintf('%s:%d:%d:%d:%d:%d:%d', $user->name, $rank, $score, $maxscore, $challsolved, $challcount, $usercount));

?>